﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

/// <summary>
/// Erweiterung fuer cardType Klasse
/// </summary>
public partial class cardType
{
    /// <summary>
    /// Leere Standardkonstruktor
    /// </summary>
    public cardType()
    {
    }

    /// <summary>
    /// CopyKonstruktor erstellt tiefe Kopie des cardTypes
    /// </summary>
    /// <param name="card"></param>
    public cardType(cardType card)
    {
        //OEffnungen
        this.openings = new cardTypeOpenings();
        this.openings.top = card.openings.top;
        this.openings.bottom = card.openings.bottom;
        this.openings.left = card.openings.left;
        this.openings.right = card.openings.right;

        //pins
        this.pin = (int[])card.pin.Clone();

        //treasure
        this.treasure = card.treasure;
        this.treasureSpecified = card.treasureSpecified;
    }

    /// <summary>
    /// Dreht die Karte nach rechts
    /// </summary>
    /// <param name="this"></param>
    public void TurnRight()
    {
        bool _lTop = this.openings.top;
        this.openings.top = this.openings.left;
        this.openings.left = this.openings.bottom;
        this.openings.bottom = this.openings.right;
        this.openings.right = _lTop;
    }

    /// <summary>
    /// dreht die Karte nach links
    /// </summary>
    /// <param name="this"></param>
    public void TurnLeft()
    {
        bool _lTop = this.openings.top;
        this.openings.top = this.openings.right;
        this.openings.right = this.openings.bottom;
        this.openings.bottom = this.openings.left;
        this.openings.left = _lTop;
    }

}

